#!usr/bin/env python  
# -*- coding:utf-8 _*-
""" 
@author:robot
@file: node03_rowfilter.py 
@version:
@time: 2022/05/18 
"""
from TapClientCore.T04_logic.Dag02.node.operate_node.node08_field_rename import FieldRenameNode


class RowFilter(FieldRenameNode):

    def generate_node(self, operations):
        if not operations:
            operations = "1 == 1"
        node = {
            "id": self.newId,
            "name": "自动化-Row_Filter",
            "processorThreadNum": 1,
            "catalog": "processor",
            "elementType": "Node",
            "type": "row_filter_processor",
            "attrs": {
                "position": [
                    -500,
                    200
                ]
            },
            "action": "retain",
            "expression": operations
        }
        self.node = node
